package com.java.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class UserService2 {
    // 属性注入
    @Autowired
    @Qualifier("user2")
    private User user;

    public void sayHi(){
        System.out.println(user.toString());
    }
}
